\documentclass{article}\begin{document}
\begin{theorem}

\declare{syntax={infix,109,"++",l}, meaning=test.test}

\declare{syntax={postfix,108,"+"}, meaning=arith1.unary_plus}


$2++$
$2++2$
\end{theorem}
\end{document}

